package com.lagou.service;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;
import org.springframework.beans.factory.annotation.Value;

@Service(version = "1.0.0")
public class DemoServiceImpl implements DemoService2 {

    @Value("${dubbo.application.name}")
    private String serviceName;

    @Override
    public String sayHello2(String name) {
        String ipAddress = RpcContext.getContext().getAttachment("ipAddress");
        return String.format("[%s] : hello , %s ,ip: %s", serviceName , name , ipAddress);
    }
}
